const dayjs = require("dayjs");

const stateDate = () => {
    let dateArr = [];
    let date = dayjs(new Date()).startOf("w").format("YYYY-MM-DD");
    let week = dayjs(date).format("ddd");
    dateArr.push({ date, week });
    for (let i = 0; i < 6; i++) {
        date = dayjs(date).add(1, "d").format("YYYY-MM-DD");
        week = dayjs(date).format("ddd");
        dateArr.push({ date, week });
    }
    dateArr = dateArr.map(item => {
        item.fulldate = item.date
        item.date = dayjs(item.date).format('DD')
        return item
    })
    return dateArr
};

export {
    stateDate
}